//
//  CMDBHomeNoticeTableView.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/11.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

private let NoticeIdentifier = "NoticeIdentifier"

class CMDBHomeNoticeTableView: CMDBRefreshTableView {

    var controller : UIViewController?
    
    override func setupTableView() {
        super.setupTableView()
        
        self.registerClass(CMDBHomeNoticeCell.self, forCellReuseIdentifier:NoticeIdentifier)
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        return dequeCellAndLoadContentFromAdapter(tableViewAdapterArray![indexPath.row] , indexPath: indexPath, tableView: self, controller: self.controller,cellReuseIdentifier : NoticeIdentifier)
        
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        
        let viewModel = tableViewdataArray![indexPath.row] as! CMDB.CMDBPublicNoticeBean
        
        return viewModel.cellHeight
    }

}
